import request from '@/utils/request'

// 查询学生请假列表
export function listLeave(query) {
  return request({
    url: '/edu/leave/list',
    method: 'get',
    params: query
  })
}

// 查询学生请假详细
export function getLeave(askLeaveId) {
  return request({
    url: '/edu/leave/' + askLeaveId,
    method: 'get'
  })
}

// 新增学生请假
export function addLeave(data) {
  return request({
    url: '/edu/leave',
    method: 'post',
    data: data
  })
}

// 修改学生请假
export function updateLeave(data) {
  return request({
    url: '/edu/leave',
    method: 'put',
    data: data
  })
}

// 删除学生请假
export function delLeave(askLeaveId) {
  return request({
    url: '/edu/leave/' + askLeaveId,
    method: 'delete'
  })
}

// 请假申请
export function apply(data) {
  return request({
    url: '/edu/leave/apply',
    method: 'post',
    data: data
  })
}

// 请假审批
export function approve(data) {
  return request({
    url: '/edu/leave/approve',
    method: 'post',
    data: data
  })
}

// 请假审批
export function revoke(id) {
  return request({
    url: '/edu/leave/revoke',
    method: 'post',
    data: {id}
  })
}
// 查询学生请假列表
export function listStudent(query) {
  return request({
    url: '/edu/leave/student/list',
    method: 'get',
    params: query
  })
}

// 查询学生请假列表
export function listCounsellor(query) {
  return request({
    url: '/edu/leave/counsellor/list',
    method: 'get',
    params: query
  })
}
